<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title></title>
<link href="../css/bootstrap-cerulean.css" rel="stylesheet">
<link href="../css/charisma-app.css" rel="stylesheet">
<style type="text/css">
body {
	padding-bottom: 40px;
}

.sidebar-nav {
	padding: 9px 0;
}
</style>
	<script src="http://lib.sinaapp.com/js/jquery/2.2.4/jquery-2.2.4.min.js"></script>
	<script src="../js/common/public.js"></script>
	<script src="../js/base64.js"></script>
	<script type="text/javascript">
        $(document).ready(function () {
            var urlMsg  = parseUrl(window.location.search);
            if (urlMsg.token!=null){
                var token = decode(urlMsg.token);
            }
            var html = $.ajax({
                type: "GET",
                url: "http://localhost:1068/admin/class/findAllClass?token="+token,
                async: false
            }).responseText;
            var result = eval('(' + html + ')');
            if (result.code!=200){
                alert(result.msg)
            }else {
				for (index in result.data){
                    addClassTable(result.data[index].classNumber,
                        result.data[index].classNumber,
						result.data[index].className,
                        result.data[index].monitor,
                        result.data[index].majorName,);
                    $('#'+ result.data[index].classNumber+'').attr('href','studentList.html?token='+urlMsg.token+'&classNumber='+result.data[index].classNumber);
				}
            }

        });

        function addClassTable(id,classNumber,className,monitor,major) {
                $("#classDetaile tbody").append("<tr class='odd'>\n" +
                    "<td class='sorting_1'>"+classNumber+"</td>\n" +
                    "<td class='center '>"+className+"</td>\n" +
                    "\<td class='center '>"+monitor+"</td>\n" +
                    "<td class='center '>"+major+"</td>\n" +
                    "<td class='center '>\n" +
                    "<a id= "+id+" class='btn btn-success' href=''>" +
                    " <i class='icon-zoom-in icon-white'></i> 查看学生</a>"+
                    "</td>\n" +
                    "</tr>");

        }
	</script>
</head>

<body>
	<div class="container-fluid"
		style="padding-left:0px;padding-right:2px;">
		<div class="row-fluid">
			<div id="content" class="span10" style="width:100%;">
				<div class="row-fluid sortable">
					<div class="box span12">
						<div class="box-header well">
							<h2>
								<i class="icon-user"></i>班级列表
							</h2>
						</div>
						<div class="box-content">
							<div id="DataTables_Table_0_wrapper" class="dataTables_wrapper">
								
								<table
									class="table table-striped table-bordered bootstrap-datatable datatable dataTable"
									id="classDetaile">
									<thead>
										<tr>
											<th class="sorting_asc" 
												rowspan="1" colspan="1"
												
												style="width: 18%;">班级代号</th>
											<th class="sorting" 
												rowspan="1" colspan="1"
												style="width: 35%;">班级名称</th>
											<th class="sorting"
												 rowspan="1" colspan="1"
												style="width: 13%;">班长</th>
											<th class="sorting" 
												 rowspan="1" colspan="1"
												style="width: 17%;">专业</th>
											<th class="sorting" 
												 rowspan="1" colspan="1"
												style="width: 17%;">操作</th>
										</tr>
									</thead>

									<tbody>

									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
